home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / AIncludes / SysEqu.a < prev    next >
Encoding:
Text File  |  1989-10-13  |  46.8 KB  |  1,271 lines  |  [TEXT/MPS ]

  1. ; Version: 2.71
  2. ; Created: Tuesday, September 19, 1989 at 1:54:04 PM
  3. ;
  4. ; File: SysEqu.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1986-1988
  8. ; All Rights Reserved
  9. ;
  10. ;___________________________________________________________________________
  11. ;
  12. ; System Equates -- This file defines the low-level equates for the
  13. ; Macintosh software. This is divided into two pieces for
  14. ; assembly space and speed considerations. The wholeSystem flag is used
  15. ; to include the less common equates which realizes a complete set. The
  16. ; comments marked with ";+" denote categories or managers. Record
  17. ; stuctures may have additional private equates which are defined by and
  18. ; reserved for use by Apple Computer, Inc.
  19. ;
  20. ;___________________________________________________________________________
  21.  
  22.                 IF            (&TYPE('wholeSystem') = 'UNDEFINED') THEN
  23. wholeSystem     EQU         1
  24.                 ENDIF
  25.  
  26.  
  27. PCDeskPat        EQU         $20B                    ; desktop pat, top bit only! others are in use
  28. HiKeyLast        EQU         $216                    ; Same as KbdVars
  29. KbdLast         EQU         $218                    ; Same as KbdVars+2
  30. ExpandMem        EQU         $2B6                    ; pointer to expanded memory block
  31.  
  32. ; Test Manager EQU's
  33. videoMagic        EQU         $5A932BC7                ; When VideoInfoOk contains this value, the video card is ok (CritErr).
  34.  
  35.  
  36. ; Unit table size constants (Used in startInit.a)
  37. unitEntries     EQU         64                        ; default # of entries in unit table
  38. maxUTEntries    EQU         unitEntries+64            ; Set Max higher so the table can grow.
  39. bgnSlotUnit     EQU         48                        ; default start unit number for slots.
  40. bgnSlotRef        EQU         -(bgnSlotUnit+1)        ; default start RefNum for slots.
  41.  
  42.  
  43.  
  44. ; Start Boot state constants.
  45. sbState0        EQU         0                        ;StartBoot code is at state-0.
  46. sbState1        EQU         1                        ;StartBoot code is at state-1.
  47.  
  48.  
  49. ; The Alarm Clock
  50.  
  51. alrmFlEnable    EQU         0                        ; 1 => alarm clock mechanism is triggered
  52. ; Apple Desktop Bus
  53. JADBProc        EQU         1720                    ; (long) procedure called on ADBReInit
  54.  
  55. ; start of new low mem
  56.  
  57. SCSIBase        EQU         $0C00                    ; (long) base address for SCSI chip read
  58. SCSIDMA         EQU         $0C04                    ; (long) base address for SCSI DMA
  59. SCSIHsk         EQU         $0C08                    ; (long) base address for SCSI handshake
  60. SCSIGlobals     EQU         $0C0C                    ; (long) ptr for SCSI mgr locals
  61. RGBBlack        EQU         $0C10                    ; (6 bytes) the black field for color
  62. RGBWhite        EQU         $0C16                    ; (6 bytes) the white field for color
  63. ; $0C1C - $0C1F unused
  64.  
  65. RowBits         EQU         $0C20                    ; (word) screen horizontal pixels
  66. ColLines        EQU         $0C22                    ; (word) screen vertical pixels
  67. ScreenBytes     EQU         $0C24                    ; (long) total screen bytes
  68.  
  69. ; $0C28 unused (was SlotDT)
  70.  
  71. NMIFlag         EQU         $0C2C                    ; (byte) flag for NMI debounce
  72. VidType         EQU         $0C2D                    ; (byte) video board type ID
  73. ScrnInval        EQU         $0C2D                    ; (byte) replaces obscure VidType.    When $FFFF, scrn resource is valid.  When cleared, it is invalid.
  74. VidMode         EQU         $0C2E                    ; (byte) video mode (4=4bit color)
  75. SCSIPoll        EQU         $0C2F                    ; (byte) poll for device zero only once.
  76. ; (init to $FFFF, by default)
  77.  
  78.  
  79. SEVarBase        EQU         $0C30                    ; ($0C30-0CB0) 128 bytes for sys err data
  80. ; note!!! - if changed, need to change also in hwequ file
  81.  
  82. MMUFlags        EQU         $0CB0                    ; (byte) cleared to zero (reserved for future use)
  83. MMUType         EQU         $0CB1                    ; (byte) kind of MMU present
  84. MMU32bit        EQU         $0CB2                    ; (byte) boolean reflecting current machine MMU mode
  85. MMUTbl            EQU         $0CB4                    ; (long) pointer to MMU Mapping table
  86. MMUTblSize        EQU         $0CB8                    ; (long) size of the 24 bit mode MMU mapping table
  87. MMU24Info        EQU         $0CB4                    ; (long) ptr to 24 bit mode MMU configuration info
  88. MMU32Info        EQU         $0CB8                    ; (long) ptr to 32 bit mode MMU configuration info
  89. SInfoPtr        EQU         $0CBC                    ; (long) pointer to Slot manager information
  90. ASCBase         EQU         $0CC0                    ; (long) pointer to Sound Chip
  91. SMGlobals        EQU         $0CC4                    ; (long) pointer to Sound Manager Globals
  92. TheGDevice        EQU         $0CC8                    ; (long) the current graphics device
  93. CQDGlobals        EQU         $0CCC                    ; (long) quickDraw global extensions
  94.  
  95. ; $0CE6-$0CE9 unused
  96.  
  97. TimeVIADB        EQU         $0CEA                    ; (word) number of iter's of VIA access & DBRA.
  98. VIA2            EQU         $0CEC                    ; VIA2 base address [pointer]
  99. RBV             EQU         VIA2                    ; RBV base address [pointer] share with VIA2
  100. VIA2RBV         EQU         VIA2                    ; VIA2 or RBV base address [pointer]
  101. OSS             EQU         VIA2                    ; OSS base address [pointer] share with VIA2
  102. VIA2RBVOSS        EQU         VIA2                    ; VIA2 or RBV or OSS base address [pointer]
  103.  
  104. ; $0CF0-$0CF7 unused
  105.  
  106. WarmStart        EQU         $0CFC                    ; (long) flag to indicate it is a warm start
  107. wmStConst        EQU         $574C5343                ; warm start constant
  108. sleepConst        EQU         'SARA'                    ; waking from sleep constant
  109. TimeDBRA        EQU         $0D00                    ; (word) number of iterations of DBRA per millisecond
  110. TimeSCCDB        EQU         $0D02                    ; (word) number of iter's of SCC access & DBRA.
  111. PmgrBase        EQU         $0D18                    ; ptr to slot tickcount table
  112.  
  113. ;4appletalk EQU $0D1C ; (long) pointer to appletalk globals
  114.  
  115. TableSeed        EQU         $0D20                    ; (long) seed value for color table ID's
  116. SRsrcTblPtr     EQU         $0D24                    ; (long) pointer to slot resource table.
  117. JVBLTask        EQU         $0D28                    ; vector to slot VBL task interrupt handler
  118. WMgrCPort        EQU         $0D2C                    ; window manager color port 
  119. VertRRate        EQU         $0D30                    ; (word) Vertical refresh rate for start manager.
  120.  
  121. ; Unused $0D43-0D53
  122.  
  123. ChunkyDepth     EQU         $0D60                    ; depth of the pixels
  124. CrsrPtr         EQU         $0D62                    ; pointer to cursor save area
  125. PortList        EQU         $0D66                    ; list of grafports 
  126. MickeyBytes     EQU         $0D6A                    ; long pointer to cursor stuff
  127. QDErr            EQU         $0D6E                    ; QuickDraw error code [word]
  128. VIA2DT            EQU         $0D70                    ; 32 bytes for VIA2 dispatch table for NuMac
  129. ; uses $0D70 - $0D8F
  130.  
  131.  
  132. SInitFlags        EQU         $0D90                    ; StartInit.a flags [word]
  133. DTQueue         EQU         $0D92                    ; (10 bytes) deferred task queue header
  134. DTQFlags        EQU         $0D92                    ; flag word for DTQueue
  135. DTskQHdr        EQU         $0D94                    ; ptr to head of queue
  136. DTskQTail        EQU         $0D98                    ; ptr to tail of queue
  137. JDTInstall        EQU         $0D9C                    ; (long) ptr to deferred task install routine
  138. HiliteRGB        EQU         $0DA0                    ; 6 bytes: rgb of hilite color
  139. DSCtrAdj        EQU         $0DA8                    ; (long) Center adjust for DS rect.
  140. IconTLAddr        EQU         $0DAC                    ; (long) pointer to where start icons are to be put.
  141. VideoInfoOK     EQU         $0DB0                    ; (long) Signals to CritErr that the Video card is ok
  142. EndSRTPtr        EQU         $0DB4                    ; (long) Pointer to the end of the Slot Resource Table (Not the SRT buffer).
  143. SDMJmpTblPtr    EQU         $0DB8                    ; (long) Pointer to the SDM jump table
  144. JSwapMMU        EQU         $0DBC                    ; (long) jump vector to SwapMMU routine
  145. SdmBusErr        EQU         $0DC0                    ; (long) Pointer to the SDM busErr handler
  146. LastTxGDevice    EQU         $0DC4                    ; (long) copy of TheGDevice set up for fast text measure
  147.  
  148. ; Unused $0DE0-... ; PLEASE MAINTAIN THIS POINTER TO UNUSED
  149.  
  150. ; CRSRSAVE $88C-8CB is no longer used
  151. ; *** RESERVED FOR USE BY QUICKDRAW ***
  152.  
  153. NewCrsrJTbl     EQU         $88C                    ; location of new crsr jump vectors
  154. NewCrsrJCnt     EQU         1                        ; 2 new vectors
  155. JAllocCrsr        EQU         $88C                    ; (long) vector to routine that allocates cursor
  156. JSetCCrsr        EQU         $890                    ; (long) vector to routine that sets color cursor
  157. JOpcodeProc     EQU         $894                    ; (long) vector to process new picture opcodes
  158. CRSRBASE        EQU         $898                    ; (long) scrnBase for cursor
  159. CrsrDevice        EQU         $89C                    ; (long) current cursor device
  160. SrcDevice        EQU         $8A0                    ; (LONG) Src device for Stretchbits
  161. MainDevice        EQU         $8A4                    ; (long) the main screen device
  162. DeviceList        EQU         $8A8                    ; (long) list of display devices
  163. CRSRROW         EQU         $8AC                    ; (word) rowbytes for current cursor screen
  164. QDColors        EQU         $8B0                    ; (long) handle to default colors
  165.  
  166. ; QuickDraw
  167.  
  168. HiliteMode        EQU         $938                    ; used for color highlighting
  169.  
  170.  
  171. ; Exception vectors
  172.  
  173. BusErrVct        EQU         $08                     ; bus error vector
  174.  
  175.  
  176. ;-------------
  177. ; MMU Equates
  178. ;-------------
  179.  
  180. ; MMU Mode bits 
  181. ;
  182. ; type MMU_Mode = (true32b,false32b)
  183.  
  184. false32b        EQU         0                        ;modified
  185. true32b         EQU         1
  186.  
  187. ;+ System Error Handler
  188.  
  189. RestProc        EQU         $A8C                    ; Resume procedure f InitDialogs [pointer]
  190.  
  191. ; equates for new queue elements
  192.  
  193. sIQType         EQU         6                        ; slot interrupt queue element ID
  194.  
  195. ;Default Startup
  196.  
  197. ;DefaultRec offsets for set/get default startup
  198.  
  199. drDriveNum        EQU         0                        ;[INTEGER]
  200. drRefNum        EQU         2                        ;[INTEGER]
  201.  
  202. ; Deferred Task Queue Element
  203.  
  204. dtQType         EQU         7                        ; deferred task queue element ID
  205. inDTQ            EQU         6                        ; bit index for "in deferred task" flag
  206. dtLink            EQU         0                        ; Link to next element [pointer]
  207. dtType            EQU         4                        ; Unique ID for validity [word]
  208. dtFlags         EQU         6                        ; optional flags [word]
  209. dtAddr            EQU         8                        ; service routine [pointer]
  210. dtParm            EQU         $C                        ; optional A1 parameter [long]
  211. dtResrvd        EQU         $10                     ; reserved [long]
  212. dtQElSize        EQU         20                        ; length of DT queue element in bytes
  213.  
  214. ; Notification Manager Queue Element
  215. nmType            EQU         8                        ; Notification request queue element ID
  216.  
  217.  
  218. ;+ ROM Equates
  219.  
  220. ROM85            EQU         $28E                    ; (word) actually high bit - 0 for ROM vers $75 (sic) and later
  221. ROMMapHndl        EQU         $B06                    ; (long) handle of ROM resource map
  222.  
  223. ;+ Screen Equates
  224.  
  225. ScrVRes         EQU         $102                    ; screen vertical dots/inch [word]
  226. ScrHRes         EQU         $104                    ; screen horizontal dots/inch [word]
  227. ScrnBase        EQU         $824                    ; Screen Base [pointer]
  228. ScreenRow        EQU         $106                    ; rowBytes of screen [word]
  229.  
  230.  
  231. ; Mouse/Keyboard
  232.  
  233. MBTicks         EQU         $16E                    ; tick count @ last mouse button [long]
  234. JKybdTask        EQU         $21A                    ; keyboard VBL task hook [pointer]
  235. KeyLast         EQU         $184                    ; ASCII for last valid keycode [word]
  236. KeyTime         EQU         $186                    ; tickcount when KEYLAST was rec'd [long]
  237. KeyRepTime        EQU         $18A                    ; tickcount when key was last repeated [long]
  238.  
  239. ;+ Parameter RAM (a twenty byte copy of the real parameter ram).
  240.  
  241. SPConfig        EQU         $1FB                    ; config bits: 4-7 A, 0-3 B (see use type below)
  242. SPPortA         EQU         $1FC                    ; SCC port A configuration [word]
  243. SPPortB         EQU         $1FE                    ; SCC port B configuration [word]
  244.  
  245. ; SCC Serial Chip Addresses
  246.  
  247. SCCRd            EQU         $1D8                    ; SCC base read address [pointer]
  248. SCCWr            EQU         $1DC                    ; SCC base write address [pointer]
  249.  
  250. ; Serial port use type
  251.  
  252. useFree         EQU         0                        ; Use undefined
  253. useATalk        EQU         1                        ; AppleTalk
  254. useAsync        EQU         2                        ; Async
  255. useExtClk        EQU         3                        ; externally clocked
  256. useMIDI         EQU         4                        ; MIDI
  257.  
  258. ; Unpacked, user versions of parameter ram
  259.  
  260. DoubleTime        EQU         $2F0                    ; double click ticks [long]
  261. CaretTime        EQU         $2F4                    ; caret blink ticks [long]
  262. KeyThresh        EQU         $18E                    ; threshold for key repeat [word]
  263. KeyRepThresh    EQU         $190                    ; key repeat speed [word]
  264. SdVolume        EQU         $260                    ; Global volume(sound) control [byte]
  265.  
  266.  
  267. ;+ System Clocks
  268.  
  269. Ticks            EQU         $16A                    ; Tick count, time since boot [long]
  270. Time            EQU         $20C                    ; clock time (extrapolated) [long]
  271.  
  272.  
  273. ;+ Cursor
  274.  
  275. iBeamCursor     EQU         1                        ; text selection cursor
  276. crossCursor     EQU         2                        ; for structured selection
  277. plusCursor        EQU         3                        ; for drawing graphics
  278. watchCursor     EQU         4                        ; for indicating a long delay
  279.  
  280.  
  281. ; result codes for Relstring call
  282.  
  283. sortsBefore     EQU         -1                        ; str1 < str2
  284. sortsEqual        EQU         0                        ; str1 = str2
  285. sortsAfter        EQU         1                        ; str1 > str2
  286.  
  287. ;+ Queue Package
  288.  
  289. qInUse            EQU         7                        ; queue-in-use flag bit
  290.  
  291. ; Header Record
  292.  
  293. qHeadSize        EQU         $A                        ; queue header size
  294. qFlags            EQU         0                        ; miscellaneous flags [word]
  295. qHead            EQU         2                        ; first element in queue [pointer]
  296. qTail            EQU         6                        ; last element in queue [pointer]
  297.  
  298. ; General Purpose Queue Element Definition
  299.  
  300. qLink            EQU         0                        ; link to next queue element [pointer]
  301. qType            EQU         4                        ; queue element type [word]
  302.  
  303.  
  304. ;+ Event Manager
  305.  
  306. evType            EQU         4                        ; event queue element is type 4
  307.  
  308. ; Event Type Numbers (in EvtNum)
  309.  
  310. everyEvent        EQU         -1
  311. nullEvt         EQU         0                        ; event 0 is the null event
  312. mButDwnEvt        EQU         1                        ; mouse button down is event 1
  313. mButUpEvt        EQU         2                        ; mouse button up is event 2
  314. keyDwnEvt        EQU         3                        ; key down is event 3
  315. keyUpEvt        EQU         4                        ; key up is event 4
  316. autoKeyEvt        EQU         5                        ; auto-repeated key is event 5
  317. updatEvt        EQU         6                        ; update event
  318. diskInsertEvt    EQU         7                        ; disk-inserted event
  319. activateEvt     EQU         8                        ; activate/deactive event
  320. netWorkEvt        EQU         $A                        ; network event
  321. ioDrvrEvt        EQU         $B                        ; driver-defined event
  322. app1Evt         EQU         $C                        ; application defined events
  323. app2Evt         EQU         $D
  324. app3Evt         EQU         $E
  325. app4Evt         EQU         $F
  326. osEvt            EQU         $F
  327.  
  328. ; Modifier bits in event record
  329. ; (same constant names are masks rather than
  330. ; bit numbers in higher level languages.)
  331.  
  332. activeFlag        EQU         $0                        ; activate?
  333. btnState        EQU         $7                        ; state of button?
  334. cmdKey            EQU         $8                        ; command key down?
  335. shiftKey        EQU         $9                        ; shift key down?
  336. alphaLock        EQU         $A                        ; alpha lock down?
  337. optionKey        EQU         $B                        ; option key down?
  338. controlKey        EQU         $C                        ; control key on new keyboard?
  339.  
  340. ; to decipher event message for keyDown events
  341. charCodeMask    EQU         $000000FF
  342. keyCodeMask     EQU         $0000FF00
  343. adbAddrMask     EQU         $00FF0000
  344.  
  345. ; OSEvent Messages
  346.  
  347. osEvtMessageMask  EQU        $FF000000
  348. mouseMovedMessage EQU        $FA
  349. childDiedMessage  EQU        $FD
  350. suspendResumeMessage EQU    $01
  351.  
  352.  
  353. ; Event Record Definition
  354.  
  355. evtNum            EQU         0                        ; event code [word]
  356. evtMessage        EQU         2                        ; event message [long]
  357. evtTicks        EQU         6                        ; ticks since startup [long]
  358. evtMouse        EQU         $A                        ; mouse location [long]
  359. evtMeta         EQU         $E                        ; state of modifier keys [byte]
  360. evtMBut         EQU         $F                        ; state of mouse button [byte]
  361. evtBlkSize        EQU         $10                     ; size in bytes of the event record
  362. MonkeyLives     EQU         $100                    ; monkey lives if >= 0 [word]
  363. SEvtEnb         EQU         $15C                    ; enable SysEvent calls from GNE [byte]
  364. JournalFlag     EQU         $8DE                    ; journaling state [word]
  365. JournalRef        EQU         $8E8                    ; Journalling driver's refnum [word]
  366.  
  367.  
  368. ;+ Memory Manager
  369.  
  370. ; Master pointer bits for handles - USE _HLock, _HPurge, etc. for portability
  371.  
  372. lock            EQU         7                        ; lock bit in a master pointer
  373. purge            EQU         6                        ; bit for purgeable/unpurgeable
  374. resource        EQU         5                        ; bit to flag a resource handle
  375.  
  376.  
  377. BufPtr            EQU         $10C                    ; top of application memory [pointer]
  378. StkLowPt        EQU         $110                    ; Lowest stack as measured in VBL task [pointer]
  379. TheZone         EQU         $118                    ; current heap zone [pointer]
  380. ApplLimit        EQU         $130                    ; application limit [pointer]
  381. SysZone         EQU         $2A6                    ; system heap zone [pointer]
  382. ApplZone        EQU         $2AA                    ; application heap zone [pointer]
  383. HeapEnd         EQU         $114                    ; end of heap [pointer]
  384. HiHeapMark        EQU         $BAE                    ; (long) highest address used by a zone below sp
  385. MemErr            EQU         $220                    ; last memory manager error [word]
  386. maxSize         EQU         $800000                 ; outrageously large memory mgr request
  387. dfltStackSize    EQU         $00002000                ; 8K size for stack
  388. mnStackSize     EQU         $00000400                ; 1K minimum size for stack
  389.  
  390. ; _InitZone argument table.
  391.  
  392. startPtr        EQU         0                        ; Start address for zone [pointer]
  393. limitPtr        EQU         4                        ; Limit address for zone [pointer]
  394. cMoreMasters    EQU         8                        ; Number of masters to allocate at time [word]
  395. pGrowZone        EQU         10                        ; growZone procedure [pointer]
  396.  
  397. ; Control/Status Call Codes
  398.  
  399. killCode        EQU         1                        ; KillIO code
  400. drvStsCode        EQU         8                        ; status call code for drive status
  401. ejectCode        EQU         7                        ; control call eject code
  402. tgBuffCode        EQU         8                        ; set tag buffer code
  403.  
  404. ; Driver flags, (Bit definitions for DCtlFlags byte)
  405.  
  406. dReadEnable     EQU         0                        ; enabled for read operations
  407. dWritEnable     EQU         1                        ; enabled for writing
  408. dCtlEnable        EQU         2                        ; enabled for control operations
  409. dStatEnable     EQU         3                        ; enabled for status operations
  410. dNeedGoodBye    EQU         4                        ; needs a "goodbye kiss"
  411. dNeedTime        EQU         5                        ; needs "main thread" time
  412. dNeedLock        EQU         6                        ; needs to be accessed at interrupt level
  413.  
  414. ; Run-Time flags, (Bit definitions for DCtlFlags+1 byte)
  415.  
  416. dOpened         EQU         5                        ; bit to mark driver 'Open'
  417. dRAMBased        EQU         6                        ; 1=RAM-based Driver, 0=ROM-based
  418. drvrActive        EQU         7                        ; bit to mark the driver active
  419.  
  420. ; Drive queue element offsets
  421.  
  422. dQDrive         EQU         $6                        ; drive number [word]
  423. dQRefNum        EQU         $8                        ; driver refnum [word]
  424. dQFSID            EQU         $A                        ; file system handling this drive [word]
  425. dQDrvSz         EQU         $C                        ; number of blocks this drive [word]
  426. dQDrvSz2        EQU         $E                        ; if qType = 1, high word of drive size
  427.  
  428. ; Queue Element Type Definitions
  429.  
  430. ioQType         EQU         2                        ; I/O queue element is type 2
  431. drvQType        EQU         3                        ; timer queue element is type 3
  432. fsQType         EQU         5                        ; File System VCB element
  433. slpQType        EQU         $10                     ; Sleep queue element is type 16
  434.  
  435. ; Device Control Entry Definition
  436. ;dCtlEntrySize used to be only 40 bytes!
  437.  
  438. dCtlEntrySize    EQU         $34                     ; length of a DCE [52 bytes]
  439. dCtlDriver        EQU         0                        ; driver [handle]
  440. dCtlFlags        EQU         4                        ; flags [word]
  441. dCtlQueue        EQU         6                        ; queue header
  442. dCtlQHead        EQU         8                        ; queue first-element [pointer]
  443. dCtlQTail        EQU         $C                        ; queue last-element [pointer]
  444. dCtlPosition    EQU         $10                     ; position [long]
  445. dCtlStorage     EQU         $14                     ; driver's private storage [handle]
  446. dCtlRefNum        EQU         $18                     ; refNum of this driver [word]
  447. dCtlCurTicks    EQU         $1A                     ; counter for timing systemTask calls [long]
  448. dCtlWindow        EQU         $1E                     ; driver's window (if any) [pointer]
  449. dCtlDelay        EQU         $22                     ; number of ticks between sysTask calls [word]
  450. dCtlEMask        EQU         $24                     ; desk accessory event mask [word]
  451. dCtlMenu        EQU         $26                     ; menu ID associated with driver [word]
  452. dCtlSlot        EQU         $28                     ; device slot Number [byte]
  453. dCtlSlotId        EQU         $29                     ; device Id within slot [byte]
  454. dCtlDevBase     EQU         $2A                     ; driver scratch ptr/offset from base to device [long]
  455. dCtlOwner        EQU         $2E                     ; ptr to task control block(ownership) [Ptr]
  456. dCtlExtDev        EQU         $32                     ; Id of external device [byte]
  457.  
  458.  
  459. ; Driver Globals
  460.  
  461. UTableBase        EQU         $11C                    ; unit I/O table [pointer]
  462. UnitNtryCnt     EQU         $1D2                    ; count of entries in unit table [word]
  463. JFetch            EQU         $8F4                    ; fetch a byte routine for drivers [pointer]
  464. JStash            EQU         $8F8                    ; stash a byte routine for drivers [pointer]
  465. JIODone         EQU         $8FC                    ; IODone entry location [pointer]
  466.  
  467. ;Chooser
  468.  
  469. chooserID        EQU         1                        ; caller value for the chooser
  470.  
  471. ;+ I/O System
  472.  
  473. ; File positioning modes for ioPosMode field of I/O record
  474.  
  475. fsAtMark        EQU         0                        ; at current position of mark
  476. fsFromStart     EQU         1                        ; offset relative to beginning of file
  477. fsFromLEOF        EQU         2                        ; offset relative to logical end-of-file
  478. fsFromMark        EQU         3                        ; offset relative to current mark
  479. rdVerify        EQU         $40                     ; read verify mode
  480.  
  481. ; Permission values for ioPermssn field of I/O record
  482.  
  483. fsCurPerm        EQU         0                        ; whatever is currently allowed
  484. fsRdPerm        EQU         1                        ; request to read only
  485. fsWrPerm        EQU         2                        ; request to write only
  486. fsRdWrPerm        EQU         3                        ; request to read and write
  487. fsRdWrShPerm    EQU         4                        ; request for shared read and write
  488.  
  489. ; I/O record (general fields with trap-specific ones listed below)
  490.  
  491. ioQElSize        EQU         $32                     ; length of I/O parameter block [50 bytes]
  492. ioLink            EQU         $0                        ; queue link in header [pointer]
  493. ioType            EQU         $4                        ; type for safety check [byte]
  494. ioTrap            EQU         $6                        ; the trap [word]
  495. ioCmdAddr        EQU         $8                        ; address to dispatch to [pointer]
  496. ioCompletion    EQU         $C                        ; completion routine [pointer]
  497. ioResult        EQU         $10                     ; I/O result code [word]
  498. ioFileName        EQU         $12                     ; file name pointer [pointer]
  499. ioVRefNum        EQU         $16                     ; volume refnum [word]
  500. ioDrvNum        EQU         $16                     ; drive number [word]
  501. ioRefNum        EQU         $18                     ; file reference number [word]
  502. ioFileType        EQU         $1A                     ; specified along with FileName [byte]
  503.  
  504. ; specific fields for _Read, _Write
  505.  
  506. ioBuffer        EQU         $20                     ; data buffer [pointer]
  507. ioByteCount     EQU         $24                     ; requested byte count [long]
  508. ioNumDone        EQU         $28                     ; actual byte count completed [long]
  509. ioPosMode        EQU         $2C                     ; initial file positioning mode/eol char [word]
  510. ioPosOffset     EQU         $2E                     ; file position offset [long]
  511.  
  512. ; specific fields for _Allocate
  513.  
  514. ioReqCount        EQU         $24                     ; requested new size [long]
  515. ioActCount        EQU         $28                     ; actual byte count allocated [long]
  516.  
  517. ; specific fields for _Open
  518.  
  519. ioPermssn        EQU         $1B                     ; permissions [byte]
  520. ioOwnBuf        EQU         $1C                     ; "private" 522-byte buffer [pointer]
  521.  
  522. ; specific fields for _ReName
  523.  
  524. ioNewName        EQU         $1C                     ; new name pointer [pointer]
  525.  
  526. ; specific fields for _GetFileInfo, _SetFileInfo
  527.  
  528. ioFQElSize        EQU         $50                     ; File command parameter length [80 bytes]
  529. ioFDirIndex     EQU         $1C                     ; directory index of file [word]
  530. ioFlAttrib        EQU         $1E                     ; in-use bit=7, lock bit=0 [byte]
  531. ioFFlType        EQU         $1F                     ; file type [byte]
  532. ioFlUsrWds        EQU         $20                     ; finder info [16 bytes]
  533. ioFFlNum        EQU         $30                     ; file number [long]
  534. ioDirID         EQU         $30                     ; directory ID
  535. ioFlStBlk        EQU         $34                     ; start file block (0000 if none) [word]
  536. ioFlLgLen        EQU         $36                     ; logical length (EOF) [long]
  537. ioFlPyLen        EQU         $3A                     ; physical length in bytes [long]
  538. ioFlRStBlk        EQU         $3E                     ; resource fork's start file block [word]
  539. ioFlRLgLen        EQU         $40                     ; resource fork's logical length (EOF) [long]
  540. ioFlRPyLen        EQU         $44                     ; resource fork's physical length [long]
  541. ioFlCrDat        EQU         $48                     ; creation date & time [long]
  542. ioFlMdDat        EQU         $4C                     ; last modification date & time [long]
  543.  
  544. ; Specific fields for _GetEOF, _SetEOF
  545.  
  546. ioLEOF            EQU         $1C                     ; logical end-of-file [long]
  547.  
  548. ; Specific fields for _SetFileType
  549.  
  550. ioNewType        EQU         $1C                     ; new type byte [byte]
  551.  
  552. ; Specific fields for _GetVolInfo, _GetVolume, _SetVolume, _MountVol, _UnmountVol,
  553. ; _Eject. Note that these traps have a bigger record size.
  554.  
  555. ioVQElSize        EQU         $40                     ; Volume command parameter length [64 bytes]
  556. ioVDrvNum        EQU         $16                     ; drive or volume number [word]
  557. ioVNPtr         EQU         $12                     ; name buffer (or zero) [pointer]
  558. ioVolIndex        EQU         $1C                     ; volume index number [word]
  559. ioVCrDate        EQU         $1E                     ; creation date & time [long]
  560. ioVLsBkUp        EQU         $22                     ; last backup date & time [long]
  561. ioVAtrb         EQU         $26                     ; Volume attributes [word]
  562. ioVNmFls        EQU         $28                     ; # files in directory [word]
  563. ioVDirSt        EQU         $2A                     ; start block of file dir [word]
  564. ioVBlLn         EQU         $2C                     ; length of dir in blocks [word]
  565. ioVNmAlBlks     EQU         $2E                     ; num blks (of alloc size) this dev [word]
  566. ioVAlBlkSiz     EQU         $30                     ; alloc blk byte size [long]
  567. ioVClpSiz        EQU         $34                     ; bytes to try to allocate at a time [long]
  568. ioAlBlSt        EQU         $38                     ; starting block in block map [word]
  569. ioVNxtFNum        EQU         $3A                     ; next free file number [long]
  570. ioVFrBlk        EQU         $3E                     ; # free alloc blks for this vol [word]
  571.  
  572. ;--- New File System Equates ---
  573. ;
  574. ; Catalog structure equates:
  575.  
  576. fsRtParID        EQU         1                        ; DirID of parent's root
  577. fsRtDirID        EQU         2                        ; Root DirID
  578. fsXTCNID        EQU         3                        ; Extent B*-Tree file ID
  579. fsCTCNID        EQU         4                        ; Catalog B*-Tree file ID
  580. fsUsrCNID        EQU         $10                     ; First assignable user CNode ID
  581.  
  582. ; Additional equates for catalog information return:
  583.  
  584. ioFlBkDat        EQU         $50                     ; File's last backup date
  585. ioFlxFndrInfo    EQU         $54                     ; File's additional finder info bytes
  586. ioFlParID        EQU         $64                     ; File's parent directory ID
  587. ioFlClpSiz        EQU         $68                     ; File's clump size, in bytes
  588.  
  589. ; Additional equates for directory information return:
  590.  
  591. ioDirFlg        EQU         4                        ; Bit in ioFlAttrb set to indicate directory
  592. ioDrUsrWds        EQU         $20                     ; Directory's user info bytes
  593. ioDrDirID        EQU         $30                     ; Directory ID
  594. ioDrNmFls        EQU         $34                     ; Number of files in a directory
  595. ioDrCrDat        EQU         $48                     ; Directory creation date
  596. ioDrMdDat        EQU         $4C                     ; Directory modification date
  597. ioDrBkDat        EQU         $50                     ; Directory backup date
  598. ioDrFndrInfo    EQU         $54                     ; Directory finder info bytes
  599. ioDrParID        EQU         $64                     ; Directory's parent directory ID
  600. ioHFQElSiz        EQU         $6C                     ; Size of a Hierarchical File Queue Element
  601.  
  602. ; Additional equates for _TFGetVolInfo:
  603.  
  604. ioVLsMod        EQU         $22                     ; Last modification date
  605. ioVSigWord        EQU         $40                     ; Volume signature
  606. ioVCBVBMst        EQU         $2A
  607. ioVNxtCNID        EQU         $3A
  608. ioVDrvInfo        EQU         $42                     ; Drive number (0 if volume is offline)
  609. ioVDRefNum        EQU         $44                     ; Driver refNum
  610. ioVFSID         EQU         $46                     ; ID of file system handling this volume
  611. ioVBkup         EQU         $48                     ; Last backup date (0 if never backed up)
  612. ioVSeqNum        EQU         $4C                     ; Sequence number of this volume in volume set
  613. ioVWrCnt        EQU         $4E                     ; Volume write count
  614. ioVFilCnt        EQU         $52                     ; Total number of files on volume
  615. ioVDirCnt        EQU         $56                     ; Total number of directories on the volume
  616. ioVFndrInfo     EQU         $5A                     ; Finder information for volume
  617. ioHVQElSize     EQU         $7A                     ; Length of Hierarchical Volume information PB
  618.  
  619. ; New fields for _GetFCBInfo:
  620.  
  621. ioFCBIndx        EQU         $1C                     ; FCB index for _GetFCBInfo
  622. ioFCBFiller1    EQU         $1E                     ; filler
  623. ioFCBFlNm        EQU         $20                     ; File number
  624. ioFCBFlags        EQU         $24                     ; FCB flags
  625. ioFCBStBlk        EQU         $26                     ; File start block
  626. ioFCBEOF        EQU         $28                     ; Logical end-of-file
  627. ioFCBPLen        EQU         $2C                     ; Physical end-of-file
  628. ioFCBCrPs        EQU         $30                     ; Current file position
  629. ioFCBVRefNum    EQU         $34                     ; Volume refNum
  630. ioFCBClpSiz     EQU         $36                     ; File clump size
  631. ioFCBParID        EQU         $3A                     ; Parent directory ID
  632. ioFCBQElSize    EQU         $3E                     ; extended size of FCBPBRec
  633.  
  634. ; New fields for _GetWDInfo:
  635.  
  636. ioWDIndex        EQU         $1A                     ; Working Directory index for _GetWDInfo
  637. ioWDProcID        EQU         $1C                     ; WD's ProcID (long)
  638. ioWDVRefNum     EQU         $20                     ; WD's Volume RefNum (word)
  639. ioWDDirID        EQU         $30                     ; WD's DirID (long)
  640.  
  641. ; New fields for _FSControl call:
  642.  
  643. ioFSVrsn        EQU         $20                     ; File system version
  644.  
  645. ; New field for CatMove
  646.  
  647. ioNewDirID        EQU         $24                     ;destination directory for CatMove
  648.  
  649. ;
  650. ;--- End of New File System Equates ---
  651.  
  652. ; Specific fields for device _Open
  653.  
  654. ioMix            EQU         $1C                     ; General purpose field imported by driver[long]
  655. ioFlags         EQU         $20                     ; General purpose flags [word]
  656. ioSlot            EQU         $22                     ; Slot [byte]
  657. ioId            EQU         $23                     ; Id [byte]
  658. ioSEBlkPtr        EQU         $22                     ; Pointer to the seBlock [long]
  659.  
  660. ; ioFlags:
  661. fMulti            EQU         $00                     ; b0 = fMulti: ioSEBlkPtr is valid (ioSlot, ioId are invalid)
  662. noCacheBit        EQU         5                        ; disable cacheing for this operation
  663. noCache         EQU         $20                     ; constant for noCacheBit
  664.  
  665. ; Specific fields for _Control, _Status
  666.  
  667. csCode            EQU         $1A                     ; control/status code [word]
  668. csParam         EQU         $1C                     ; operation-defined parameters [22 bytes]
  669.  
  670. ; FInfo (Finder Information) record layout
  671.  
  672. fdType            EQU         $0                        ; type of file [long]
  673. fdCreator        EQU         $4                        ; file's creator [long]
  674. fdFlags         EQU         $8                        ; flags [word]
  675. fdLocation        EQU         $A                        ; file's location [point]
  676. fdFldr            EQU         $E                        ; file's window [word]
  677.  
  678. ; added for HFS
  679.  
  680. ; FXInfo record layout
  681.  
  682. fdIconID        EQU         $0                        ; Icon ID [word]
  683. fdUnused        EQU         $2                        ; unused but reserved [4 words]
  684. fdComment        EQU         $A                        ; Comment ID [word]
  685. fdPutAway        EQU         $C                        ; Home Dir ID [2 words]
  686.  
  687. ; DInfo record layout
  688.  
  689. frRect            EQU         $0                        ; Folder Rect [4 words]
  690. frFlags         EQU         $8                        ; Flags [word]
  691. frLocation        EQU         $A                        ; Location [2 words]
  692. frView            EQU         $E                        ; Folder view [word]
  693.  
  694. ; DXInfo record layout
  695.  
  696. frScroll        EQU         $0                        ; scroll position [2 words]
  697. frOpenChain     EQU         $4                        ; dirID chain of open folders [2 words]
  698. frUnused        EQU         $8                        ; unused but reserved [word]
  699. frComment        EQU         $A                        ; comment [word]
  700. frPutAway        EQU         $C                        ; Dir ID [2 words]
  701.  
  702. ;end of addition
  703.  
  704. ; Masks for fdFlags field of FInfo record defined above
  705.  
  706. fOnDesk         EQU         1
  707. fHasBundle        EQU         8192                    ; set if file has a bundle
  708. fInvisible        EQU         16384                    ; set if file's icon is invisible
  709. fTrash            EQU         -3                        ; file is in Trash window
  710. fDeskTop        EQU         -2                        ; file is on desktop
  711. fDisk            EQU         0                        ; file is in disk window
  712.  
  713. ; File System Globals
  714.  
  715. DrvQHdr         EQU         $308                    ; queue header of drives in system [10 bytes]
  716. BootDrive        EQU         $210                    ; drive number of boot drive [word]
  717. EjectNotify     EQU         $338                    ; eject notify procedure [pointer]
  718. IAZNotify        EQU         $33C                    ; world swaps notify procedure [pointer]
  719. SFSaveDisk        EQU         $214                    ; last vRefNum seen by standard file [word]
  720. CurDirStore     EQU         $398                    ; save dir across calls to Standard File [long]
  721.  
  722. ;+ Date-Time record (for use with _Secs2Date, and _Date2Secs)
  723.  
  724. DateTimeRec     RECORD        0
  725. year            DS.W        1
  726. month            DS.W        1
  727. day             DS.W        1
  728. hour            DS.W        1
  729. minute            DS.W        1
  730. second            DS.W        1
  731. dayOfWeek        DS.W        1
  732. DateTimeRecSize   EQU        *
  733.                 ENDR
  734.  
  735. dtYear            EQU         $0                        ; year (1904..) [word]
  736. dtMonth         EQU         $2                        ; month (1..12) [word]
  737. dtDay            EQU         $4                        ; day (1..31) [word]
  738. dtHour            EQU         $6                        ; hour (0..23) [word]
  739. dtMinute        EQU         $8                        ; minute (0..59) [word]
  740. dtSecond        EQU         $A                        ; second (0..59) [word]
  741. dtDayOfWeek     EQU         $C                        ; day of week, sunday..saturday (1..7) [word]
  742.  
  743.  
  744. ;+ Miscellaneous stuff
  745.  
  746. OneOne            EQU         $A02                    ; constant $00010001 [long]
  747. MinusOne        EQU         $A06                    ; constant $FFFFFFFF [long]
  748. Lo3Bytes        EQU         $31A                    ; constant $00FFFFFF [long]
  749. ROMBase         EQU         $2AE                    ; ROM base address [pointer]
  750. RAMBase         EQU         $2B2                    ; RAM base address [pointer]
  751. SysVersion        EQU         $15A                    ; version # of RAM-based system [word]
  752. RndSeed         EQU         $156                    ; random seed/number [long]
  753.  
  754. ; New fields for _GetDefaultStartup: [DefStartRec]
  755. ; SlotDev:
  756. sdExtDevID        EQU         $0                        ; [byte]
  757. sdPartition     EQU         $1                        ; [byte]
  758. sdSlotNum        EQU         $2                        ; [byte]
  759. sdSRsrcID        EQU         $3                        ; [byte]
  760. ; SCSIDev:
  761. sdReserved1     EQU         $0                        ; [byte]
  762. sdReserved2     EQU         $1                        ; [byte]
  763. sdRefNum        EQU         $2                        ; [word]
  764.  
  765. ; New fields for _GetVideoDefault: [DefVideoRec]
  766.  
  767. sdSlot            EQU         $0                        ; [byte]
  768. sdSResource     EQU         $1                        ; [byte]
  769.  
  770. ; New fields for _GetOSDefault: [DefOSRec]
  771.  
  772. sdReserved        EQU         $0                        ; [byte]
  773. sdOSType        EQU         $1                        ; [byte]
  774.  
  775.  
  776. ;+ SysEnvirons info
  777.  
  778.  
  779. SysEnvRec        RECORD        0
  780. environsVersion   DS.W        1
  781. machineType     DS.W        1
  782. systemVersion    DS.W        1
  783. processor        DS.W        1
  784. hasFPU            DS.B        1
  785. hasColorQD        DS.B        1
  786. keyBoardType    DS.W        1
  787. atDrvrVersNum    DS.W        1
  788. sysVRefNum        DS.W        1
  789.                 ALIGN        2
  790. sysEnv1Size     EQU         *-SysEnvRec             ; size for version 1
  791.                 ENDR
  792.  
  793. curSysEnvVers    EQU         1                        ; latest SysEnvirons version
  794.  
  795. ; return values
  796.  
  797. envMachUnknown    EQU         0
  798. env512KE        EQU         1
  799. envMacPlus        EQU         2
  800. envSE            EQU         3
  801. envMacII        EQU         4
  802. envMacIIx        EQU         5
  803. envMacIIcx        EQU         6
  804. envSE30         EQU         7
  805. envPortable     EQU         8
  806. envMacIIci        EQU         9
  807. envMac            EQU         -1                        ; for the glue (sigh)
  808. envXL            EQU         -2                        ; for the glue (double sigh)
  809. envCPUUnknown    EQU         0                        ; CPU types
  810. env68000        EQU         1
  811. env68010        EQU         2
  812. env68020        EQU         3
  813. env68030        EQU         4
  814. envUnknownKbd    EQU         0                        ; Keyboard types
  815. envMacKbd        EQU         1
  816. envMacAndPad    EQU         2
  817. envMacPlusKbd    EQU         3
  818. envAExtendKbd    EQU         4
  819. envStandADBKbd    EQU         5
  820. envPortADBKbd    EQU         6
  821. envPortISOADBKbd  EQU        7
  822. envStdISOADBKbd   EQU        8
  823. envExtISOADBKbd   EQU        9
  824.  
  825.  
  826. ;+ Scratch Areas
  827.  
  828. Scratch20        EQU         $1E4                    ; scratch [20 bytes]
  829. Scratch8        EQU         $9FA                    ; scratch [8 bytes]
  830.  
  831.  
  832. ;+ Scrap Manager
  833.  
  834. ScrapSize        EQU         $960                    ; scrap length [long]
  835. ScrapHandle     EQU         $964                    ; memory scrap [handle]
  836. ScrapCount        EQU         $968                    ; validation byte [word]
  837. ScrapState        EQU         $96A                    ; scrap state [word]
  838. ScrapName        EQU         $96C                    ; pointer to scrap name [pointer]
  839.  
  840.  
  841. ;+ Desk Accessories
  842.  
  843.  
  844. ; Message Definitions (in CSCode of control call)
  845.  
  846. accEvent        EQU         $40                     ; event message from SystemEvent
  847. accRun            EQU         $41                     ; run message from SystemTask
  848. accCursor        EQU         $42                     ; cursor message from SystemTask
  849. accMenu         EQU         $43                     ; menu message from SystemMenu
  850. accUndo         EQU         $44                     ; undo message from SystemEdit
  851. accCut            EQU         $46                     ; cut message from SystemEdit
  852. accCopy         EQU         $47                     ; copy message from SystemEdit
  853. accPaste        EQU         $48                     ; paste message from SystemEdit
  854. accClear        EQU         $49                     ; clear message from SystemEdit
  855. goodBye         EQU         -1                        ; goodbye message
  856.  
  857.  
  858.                 IF            wholeSystem=1 THEN
  859.  
  860. ;International stuff
  861.  
  862. IntlSpec        EQU         $BA0                    ; (long) - ptr to extra Intl data
  863.  
  864. ;Switcher
  865.  
  866. SwitcherTPtr    EQU         $286                    ; Switcher's switch table 
  867.  
  868. ; Trap bits for memory manager
  869.  
  870. tSysOrCurZone    EQU         10                        ; bit set implies System Zone
  871. ; bit clear implies Current Zone
  872. clearBit        EQU         9                        ; bit set means clear allocated memory.
  873.  
  874.  
  875. ; Peripheral chips and Magic Hardware addresses
  876.  
  877. CPUFlag         EQU         $12F                    ; $00=68000, $01=68010, $02=68020 (old ROM inits to $00)
  878. ; (this is old DskWr11 flag . . .)
  879.  
  880. ; VIA (6522) interface chip
  881.  
  882. VIA             EQU         $1D4                    ; VIA base address [pointer]
  883.  
  884. ; Disk Address
  885.  
  886. IWM             EQU         $1E0                    ; IWM base address [pointer]
  887.  
  888.  
  889. ; Interrupt secondary vectors
  890.  
  891. Lvl1DT            EQU         $192                    ; Interrupt level 1 dispatch table [32 bytes]
  892. Lvl2DT            EQU         $1B2                    ; Interrupt level 2 dispatch table [32 bytes]
  893. ExtStsDT        EQU         $2BE                    ; SCC ext/sts secondary dispatch table [16 bytes]
  894.  
  895.  
  896.  
  897. ; Parameter Ram
  898.  
  899. SPValid         EQU         $1F8                    ; validation field ($A7) [byte]
  900. SPATalkA        EQU         $1F9                    ; AppleTalk node number hint for port A
  901. SPATalkB        EQU         $1FA                    ; AppleTalk node number hint for port B
  902. SPAlarm         EQU         $200                    ; alarm time [long]
  903. SPFont            EQU         $204                    ; default application font number minus 1 [word]
  904. SPKbd            EQU         $206                    ; kbd repeat thresh in 4/60ths [2 4-bit]
  905. SPPrint         EQU         $207                    ; print stuff [byte]
  906. SPVolCtl        EQU         $208                    ; volume control [byte]
  907. SPClikCaret     EQU         $209                    ; double click/caret time in 4/60ths[2 4-bit]
  908. SPMisc1         EQU         $20A                    ; miscellaneous [1 byte]
  909. SPMisc2         EQU         $20B                    ; miscellaneous [1 byte]
  910. GetParam        EQU         $1E4                    ; system parameter scratch [20 bytes]
  911. SysParam        EQU         $1F8                    ; system parameter memory [20 bytes]
  912.  
  913. ; Cursor
  914.  
  915. CrsrThresh        EQU         $8EC                    ; delta threshold for mouse scaling [word]
  916. JCrsrTask        EQU         $8EE                    ; address of CrsrVBLTask [long]
  917. MTemp            EQU         $828                    ; Low-level interrupt mouse location [long]
  918. RawMouse        EQU         $82C                    ; un-jerked mouse coordinates [long]
  919. CrsrRect        EQU         $83C                    ; Cursor hit rectangle [8 bytes]
  920. TheCrsr         EQU         $844                    ; Cursor data, mask & hotspot [68 bytes]
  921. CrsrAddr        EQU         $888                    ; Address of data under cursor [long]
  922. CrsrSave        EQU         $88C                    ; data under the cursor [64 bytes]
  923. CrsrVis         EQU         $8CC                    ; Cursor visible? [byte]
  924. CrsrBusy        EQU         $8CD                    ; Cursor locked out? [byte]
  925. CrsrNew         EQU         $8CE                    ; Cursor changed? [byte]
  926. CrsrState        EQU         $8D0                    ; Cursor nesting level [word]
  927. CrsrObscure     EQU         $8D2                    ; Cursor obscure semaphore [byte]
  928.  
  929. ; Mouse/Keyboard
  930.  
  931. KbdVars         EQU         $216                    ; Keyboard manager variables [4 bytes]
  932. KbdType         EQU         $21E                    ; keyboard model number [byte]
  933. MBState         EQU         $172                    ; current mouse button state [byte]
  934. KeyMap            EQU         $174                    ; bitmap of the keyboard [2 longs]
  935. KeypadMap        EQU         $17C                    ; bitmap for numeric pad-18bits [long]
  936. Key1Trans        EQU         $29E                    ; keyboard translator procedure [pointer]
  937. Key2Trans        EQU         $2A2                    ; numeric keypad translator procedure [pointer]
  938. JGNEFilter        EQU         $29A                    ; GetNextEvent filter proc [pointer]
  939. KeyMVars        EQU         $B04                    ; (word) for ROM KEYM proc state
  940. Mouse            EQU         $830                    ; processed mouse coordinate [long]
  941. CrsrPin         EQU         $834                    ; cursor pinning rectangle [8 bytes]
  942. CrsrCouple        EQU         $8CF                    ; cursor coupled to mouse? [byte]
  943. CrsrScale        EQU         $8D3                    ; cursor scaled? [byte]
  944. MouseMask        EQU         $8D6                    ; V-H mask for ANDing with mouse [long]
  945. MouseOffset     EQU         $8DA                    ; V-H offset for adding after ANDing [long]
  946.  
  947. ; System Clocks
  948.  
  949. AlarmState        EQU         $21F                    ; Bit7=parity, Bit6=beeped, Bit0=enable [byte]
  950.  
  951.  
  952. ;+ Vertical Blanking Interrupt Handler
  953.  
  954. ; VBL Block Queue Element
  955.  
  956. vType            EQU         1                        ; VBL queue element is type 1
  957. inVbl            EQU         6                        ; bit index for "in VBL" flag
  958. vblink            EQU         0                        ; Link to next element [pointer]
  959. vblType         EQU         4                        ; Unique ID for validity [word]
  960. vblAddr         EQU         6                        ; service routine [pointer]
  961. vblCount        EQU         $A                        ; timeout count [word]
  962. vblPhase        EQU         $C                        ; phase count [word]
  963. VBLQueue        EQU         $160                    ; VBL queue header [10 bytes]
  964.  
  965. ; Event manager
  966.  
  967. jPlayCtl        EQU         16                        ; playBack call
  968. jRecordCtl        EQU         17                        ; record call
  969. jcTickCount     EQU         0                        ; journal code for TickCount
  970. jcGetMouse        EQU         1                        ; journal code for GetMouse
  971. jcButton        EQU         2                        ; journal code for Button
  972. jcGetKeys        EQU         3                        ; journal code for GetKeys
  973. jcEvent         EQU         4                        ; journal code for GetNextEvent(Avail)
  974. SysEvtMask        EQU         $144                    ; system event mask [word]
  975. SysEvtBuf        EQU         $146                    ; system event queue element buffer [pointer]
  976. EventQueue        EQU         $14A                    ; event queue header [10 bytes]
  977. EvtBufCnt        EQU         $154                    ; max number of events in SysEvtBuf - 1 [word]
  978.  
  979. ; Event Queue Element Data Stucture
  980.  
  981. evtQWhat        EQU         6                        ; event code [word]
  982. evtQMessage     EQU         8                        ; event message [long]
  983. evtQWhen        EQU         $C                        ; ticks since startup [long]
  984. evtQWhere        EQU         $10                     ; mouse location [long]
  985. evtQMeta        EQU         $14                     ; state of modifier keys [byte]
  986. evtQMBut        EQU         $15                     ; state of mouse button [byte]
  987. evtQBlkSize     EQU         $16                     ; size of event record counting queue info
  988.  
  989. ; flags in flags field in heapzone header
  990.  
  991. fOnCheck        EQU         0                        ; Turn On Checking
  992. fChecking        EQU         1                        ; Checking on
  993. fNSelCompct     EQU         4                        ; Use non-selective compact algorithm when 1.
  994. fNoRvrAlloc     EQU         5                        ; Don't use rover allocation scheme when 1.
  995. fNSelPurge        EQU         6                        ; Use non-selective purge algorithm when 1.
  996. fRelAtEnd        EQU         7                        ; MakeBk packs rels at end of free bk when 1.
  997. ROZ             EQU         $0                        ; bit in flags field of MemMgr zone header
  998.  
  999. ; Block Types
  1000.  
  1001. tybkMask        EQU         3                        ; Mask for block type
  1002. tybkFree        EQU         0                        ; Free Block
  1003. tybkNRel        EQU         1                        ; Non-Relocatable
  1004. tybkRel         EQU         2                        ; Relocatable
  1005.  
  1006. ; Block Offsets
  1007.  
  1008. tagBC            EQU         0                        ; Tag and Byte Count field [long]
  1009. handle            EQU         4                        ; back pointer to master pointer [pointer]
  1010. blkData         EQU         8                        ; data starts here
  1011.  
  1012. ; Heap Zone header
  1013.  
  1014. bkLim            EQU         $0                        ; last block in zone [pointer]
  1015. purgePtr        EQU         $4                        ; roving purge placeholder [pointer]
  1016. hFstFree        EQU         $8                        ; first free handle [pointer]
  1017. zcbFree         EQU         $C                        ; # of free bytes in zone [long]
  1018. gzProc            EQU         $10                     ; grow zone procedure [pointer]
  1019. mAllocCnt        EQU         $14                     ; # of master ptrs to allocate [word]
  1020. flags            EQU         $16                     ; Flags [word]
  1021. cntRel            EQU         $18                     ; # of allocated relocatable blocks [word]
  1022. maxRel            EQU         $1A                     ; max # of allocated rel. blocks [word]
  1023. cntNRel         EQU         $1C                     ; # of allocated non-rel. blocks [word]
  1024. maxNRel         EQU         $1E                     ; max # of allocated non-rel. blocks [word]
  1025. cntEmpty        EQU         $20                     ; # of empty handles [word]
  1026. cntHandles        EQU         $22                     ; total # of handles [word]
  1027. minCBFree        EQU         $24                     ; min # of bytes free [long]
  1028. purgeProc        EQU         $28                     ; purge warning procedure [pointer]
  1029. allocPtr        EQU         $30                     ; roving allocator [pointer]
  1030. heapData        EQU         $34                     ; start of heap zone data
  1031.  
  1032.  
  1033.  
  1034. GZRootHnd        EQU         $328                    ; root handle for GrowZone [handle]
  1035. GZRootPtr        EQU         $32C                    ; root pointer for GrowZone [pointer]
  1036. GZMoveHnd        EQU         $330                    ; moving handle for GrowZone [handle]
  1037. MemTop            EQU         $108                    ; top of memory [pointer]
  1038. MmInOK            EQU         $12E                    ; initial memory mgr checks ok? [byte]
  1039. HpChk            EQU         $316                    ; heap check RAM code [pointer]
  1040. MaskBC            EQU         $31A                    ; Memory Manager Byte Count Mask [long]
  1041. MaskHandle        EQU         $31A                    ; Memory Manager Handle Mask [long]
  1042. MaskPtr         EQU         $31A                    ; Memory Manager Pointer Mask [long]
  1043. MinStack        EQU         $31E                    ; min stack size used in InitApplZone [long]
  1044. DefltStack        EQU         $322                    ; default size of stack [long]
  1045. MMDefFlags        EQU         $326                    ; default zone flags [word]
  1046.  
  1047. ;+ System Error Handler
  1048.  
  1049. DSAlertTab        EQU         $2BA                    ; system error alerts [pointer]
  1050. DSAlertRect     EQU         $3F8                    ; rectangle for disk-switch alert [8 bytes]
  1051. DSDrawProc        EQU         $334                    ; alternate syserror draw procedure [pointer]
  1052. DSWndUpdate     EQU         $15D                    ; GNE not to paintBehind DS AlertRect? [byte]
  1053. WWExist         EQU         $8F2                    ; window manager initialized? [byte]
  1054. QDExist         EQU         $8F3                    ; quickdraw is initialized [byte]
  1055. ResumeProc        EQU         $A8C                    ; Resume procedure from InitDialogs [pointer]
  1056. DSErrCode        EQU         $AF0                    ; last system error alert ID
  1057.  
  1058. ;+ Drivers
  1059.  
  1060. dskRfN            EQU         $FFFB                    ; 3.5" disk reference number
  1061. IntFlag         EQU         $15F                    ; reduce interrupt disable time when bit 7 = 0
  1062.  
  1063. ; Serial I/O Driver
  1064.  
  1065. SerialVars        EQU         $2D0                    ; async driver variables [16 bytes]
  1066. ABusVars        EQU         $2D8                    ;Pointer to AppleTalk local variables
  1067. ABusDCE         EQU         $2DC                    ;Pointer to AppleTalk DCE
  1068. PortAUse        EQU         $290                    ; bit 7: 1 = not in use, 0 = in use
  1069. ; bits 0-3: current use of port (see use type)
  1070. ; bits 4-6: user specific
  1071. PortBUse        EQU         $291                    ; port B use, same format as PortAUse
  1072. SCCASts         EQU         $2CE                    ; SCC read reg 0 last ext/sts rupt - A [byte]
  1073. SCCBSts         EQU         $2CF                    ; SCC read reg 0 last ext/sts rupt - B [byte]
  1074.  
  1075. ; Serial handshake record definition
  1076.  
  1077. shFXOn            EQU         $0                        ; XOn/XOff output control flags [byte]
  1078. shFCTS            EQU         $1                        ; CTS hardware handshake flag [byte]
  1079. shXOn            EQU         $2                        ; XOn character [byte]
  1080. shXOff            EQU         $3                        ; XOff character [byte]
  1081. shErrs            EQU         $4                        ; errors that cause abort [byte]
  1082. shEvts            EQU         $5                        ; status changes that cause events [byte]
  1083. shFInX            EQU         $6                        ; XOn/XOff input flow control flag [byte]
  1084. shNull            EQU         $7                        ; not used [byte]
  1085.  
  1086. ; Serial status record definition
  1087.  
  1088. ssCumErrs        EQU         $0                        ; cumulative errors [byte]
  1089. ssXOffSent        EQU         $1                        ; XOff sent as input control flag [byte]
  1090. ssRdPend        EQU         $2                        ; read pending flag [byte]
  1091. ssWrPend        EQU         $3                        ; write pending flag [byte]
  1092. ssCTSHold        EQU         $4                        ; CTS flow control hold flag [byte]
  1093. ssXOffHold        EQU         $5                        ; XOff received as output flow control [byte]
  1094.  
  1095. ; Disk Driver
  1096.  
  1097. ; Driver Code Header (for I/O drivers, desk accessories)
  1098.  
  1099. drvrFlags        EQU         $0                        ; various flags and permissions [word]
  1100. drvrDelay        EQU         $2                        ; # of ticks between systask calls [word]
  1101. drvrEMask        EQU         $4                        ; event mask [word]
  1102. drvrMenu        EQU         $6                        ; driver menu ID [word]
  1103. drvrOpen        EQU         $8                        ; open routine offset [word]
  1104. drvrPrime        EQU         $A                        ; prime routine offset [word]
  1105. drvrCtl         EQU         $C                        ; control routine offset [word]
  1106. drvrStatus        EQU         $E                        ; status routine offset [word]
  1107. drvrClose        EQU         $10                     ; warmstart reset routine offset [word]
  1108. drvrName        EQU         $12                     ; length byte and name of driver [string]
  1109. ;drvrVersion EQU ??? ; Driver w/ highest version # installed [word]
  1110. ; This field's offset varies depending upon the length
  1111. ; of the Name field preceding it. It must be word aligned!
  1112.  
  1113. ; Driver Status record definition
  1114.  
  1115. dsTrack         EQU         $0                        ; current track [word]
  1116. dsWriteProt     EQU         $2                        ; bit 7=1 if volume locked [byte]
  1117. dsDiskInPlace    EQU         $3                        ; disk in place [byte]
  1118. dsInstalled     EQU         $4                        ; drive installed [byte]
  1119. dsSides         EQU         $5                        ; bit 7=0 if single-sided drive [byte]
  1120. dsQLink         EQU         $6                        ; next queue entry [pointer]
  1121. dsDQVers        EQU         $A                        ; 1 for HD20 [word]
  1122. dsDQDrive        EQU         $C                        ; drive number [word]
  1123. dsDQRefNum        EQU         $E                        ; driver reference number [word]
  1124. dsDQFSID        EQU         $10                     ; file-system identifier [word]
  1125. dsTwoSideFmt    EQU         $12                     ; -1 if two-sided disk [byte]
  1126. dsDiskErrs        EQU         $14                     ; error count [word]
  1127. dsDrvSize        EQU         $12                     ;drive block size low word [word]
  1128. dsDrvS1         EQU         $14                     ;drive block size high word [word]
  1129. dsDrvType        EQU         $16                     ;1 for HD20 [word]
  1130. dsDrvManf        EQU         $18                     ;1 for Apple Computer, Inc [word]
  1131. dsDrvChar        EQU         $1A                     ;230 ($E6) for HD20 [word]
  1132. dsDrvMisc        EQU         $1C                     ;0 -- reserved [byte]
  1133.  
  1134.  
  1135. DskErr            EQU         $142                    ; disk routine result code [word]
  1136. PWMBuf2         EQU         $312                    ; PWM buffer 1 (or 2 if sound) [pointer]
  1137.  
  1138. ; Drive command codes
  1139.  
  1140. dcRead            EQU         0
  1141. dcWrite         EQU         1
  1142. dcStatus        EQU         3
  1143. dcInit            EQU         25
  1144. dcScan            EQU         26
  1145.  
  1146. ; Sound Stuff
  1147.  
  1148. SoundPtr        EQU         $262                    ; 4VE sound definition table [pointer]
  1149. SoundBase        EQU         $266                    ; sound bitMap [pointer]
  1150. SoundVBL        EQU         $26A                    ; vertical retrace control element [16 bytes]
  1151. SoundDCE        EQU         $27A                    ; sound driver DCE [pointer]
  1152. SoundActive     EQU         $27E                    ; sound is active? [byte]
  1153. SoundLevel        EQU         $27F                    ; current level in buffer [byte]
  1154. CurPitch        EQU         $280                    ; current pitch value [word]
  1155.  
  1156. ; I/O System
  1157.  
  1158. noQueueBit        EQU         $9                        ; tells I/O system not to queue the request
  1159. asyncTrpBit     EQU         $A                        ; bit in high byte of trap specifying async
  1160. ToExtFS         EQU         $3F2                    ; hook for external file systems
  1161.  
  1162. ; File System Globals
  1163.  
  1164. DskVerify        EQU         $12C                    ; used by 3.5 disk driver for read/verify [byte]
  1165. TagData         EQU         $2FA                    ; sector tag info for disk drivers [14 bytes]
  1166. BufTgFNum        EQU         $2FC                    ; file number [long]
  1167. BufTgFFlg        EQU         $300                    ; flags [word]
  1168. BufTgFBkNum     EQU         $302                    ; logical block number [word]
  1169. BufTgDate        EQU         $304                    ; time stamp [word]
  1170.  
  1171. ; I/O Command Equates for I/O Queue Elements (match trap numbers)
  1172.  
  1173. aRdCmd            EQU         2                        ; read command
  1174. aWrCmd            EQU         3                        ; write command
  1175. aCtlCmd         EQU         4                        ; control command
  1176. aStsCmd         EQU         5                        ; status command
  1177.  
  1178. ; New fields for _SetPMSP call: PMSP = "Poor Man's Search Path"
  1179.  
  1180. ioPMSPFlg        EQU         $1A                     ; Flag whether to enable the PMSP
  1181. ioPMSPHook        EQU         $1C                     ; Pointer to PMSP hook proc
  1182.  
  1183. ; Print variables
  1184.  
  1185. ScrDmpEnb        EQU         $2F8                    ; screen dump enabled? [byte]
  1186. ScrDmpType        EQU         $2F9                    ; FF dumps screen, FE dumps front window [byte]
  1187.  
  1188. ; Scrap Variables
  1189.  
  1190. ScrapVars        EQU         $960                    ; scrap manager variables [32 bytes]
  1191. ScrapInfo        EQU         $960                    ; scrap length [long]
  1192. ScrapEnd        EQU         $980                    ; end of scrap vars
  1193. ScrapTag        EQU         $970                    ; scrap file name [STRING[15]]
  1194.  
  1195. ; Segment Loader
  1196.  
  1197. LaunchFlag        EQU         $902                    ; from launch or chain [byte]
  1198. SaveSegHandle    EQU         $930                    ; seg 0 handle [handle]
  1199. CurJTOffset     EQU         $934                    ; current jump table offset [word]
  1200. CurPageOption    EQU         $936                    ; current page 2 configuration [word]
  1201. LoaderPBlock    EQU         $93A                    ; param block for ExitToShell [10 bytes]
  1202. CurApRefNum     EQU         $900                    ; refNum of application's resFile [word]
  1203. CurrentA5        EQU         $904                    ; current value of A5 [pointer]
  1204. CurStackBase    EQU         $908                    ; current stack base [pointer]
  1205. CurApName        EQU         $910                    ; name of application [STRING[31]]
  1206. LoadTrap        EQU         $12D                    ; trap before launch? [byte]
  1207. SegHiEnable     EQU         $BB2                    ; (byte) 0 to disable MoveHHi in LoadSeg
  1208.  
  1209. ;device manager - Chooser message values
  1210.  
  1211. newSelMsg        EQU         12                        ;a new selection has been made
  1212. fillListMsg     EQU         13                        ;fill the list with choices to be made
  1213. getSelMsg        EQU         14                        ;mark one or more choices as selcted
  1214. selectMsg        EQU         15                        ;a choice has actually been made
  1215. deselectMsg     EQU         16                        ;a choice has been canceled
  1216. terminateMsg    EQU         17                        ;lets device package clean up
  1217. buttonMsg        EQU         19                        ;a button has been clicked
  1218. psAlert         EQU         6                        ;page setup alert bit in HiliteMode
  1219. theChooser        EQU         1
  1220.  
  1221. ; cdev message types
  1222. initDev         EQU         0                        ; Time for cdev to initialize itself
  1223. hitDev            EQU         1                        ; Hit on one of my items
  1224. closeDev        EQU         2                        ; Close yourself
  1225. nulDev            EQU         3                        ; Null event
  1226. updateDev        EQU         4                        ; Update event
  1227. activDev        EQU         5                        ; Activate event
  1228. deactivDev        EQU         6                        ; Deactivate event
  1229. keyEvtDev        EQU         7                        ; Key down/auto key
  1230. macDev            EQU         8                        ; Decide whether or not to show up
  1231. undoDev         EQU         9
  1232. cutDev            EQU         10
  1233. copyDev         EQU         11
  1234. pasteDev        EQU         12
  1235. clearDev        EQU         13
  1236.  
  1237. ; cdev error codes
  1238. cdevGenErr        EQU         -1                        ; General error; gray cdev w/o alert
  1239. cdevMemErr        EQU         0                        ; Memory shortfall; alert user please
  1240. cdevResErr        EQU         1                        ; Couldn't get a needed resource; alert
  1241. cdevUnset        EQU         3                        ; cdevValue is initialized to this
  1242. ;___________________________________________________________________________
  1243. ;
  1244. ; Background Notification Manager
  1245.  
  1246. BNMQHd            EQU         $B60                    ; head of background notification Q
  1247. ExpandMemRec    RECORD        0
  1248. emVersion        DS.W        1                        ; version of expanded memory
  1249. emSize            DS.L        1                        ; length of em
  1250. emIntlGlobals    DS.L        1                        ; international globals pointer
  1251. emKeyDeadState    DS.L        1                        ; Key1Trans, Key2Trans dead state
  1252. emKeyCache        DS.L        1                        ; KCHR keyboard cache
  1253. emIntlDef        DS.L        1                        ;Reserved for Intl        
  1254. emFirstKeyboard   DS.B        1                        ;flag byte
  1255. emAlign         DS.B        1                        ;long-align until we need this storage
  1256. emItlCacheSize    EQU         16                        ;bytes in cache         
  1257. emItlCache        DS.B        emItlCacheSize            ;reserve room for cache
  1258. emItlNeedUnlock   DS.B        1                        ;for pack6
  1259. emItlDirectGetIntl DS.B     1                        ;for pack6
  1260. emFiller        DS.B        22                        ;Reserved room        
  1261. emCurVersion    EQU         $0103                    ;version 1.3        
  1262. emRecSize        EQU         *                        ;size for this version
  1263.                 ENDR
  1264.  
  1265.  
  1266.  
  1267. JDoEject        EQU         4*($F7)+$0400            ; Sony Driver jump vectors
  1268.  
  1269.  
  1270.                 ENDIF
  1271.